ActionController::Routing::Routes.draw do |map|

  map.root                                                  :controller => "welcome"

  map.resource    :user_session
  map.resource    :account,                                 :controller => "users"
  map.resources   :users

  map.connect     "/decorates/js",                          :controller => "decorates",       :action => "index",  :decorate_type => "javascript"
  map.connect     "/decorates/css",                         :controller => "decorates",       :action => "index",  :decorate_type => "stylesheet"
  
  map.resources   :decorates

  map.connect     "/login",                                 :controller => "user_sessions",   :action => "new"

  map.connect     "/doc/:section_code/:document_code",      :controller => "document",        :action => "show"
  map.connect     "/docs/:section_code/new/:subject",       :controller => "document",        :action => "new"
  map.connect     "/docs/:section_code/new",                :controller => "document",        :action => "new"
  map.connect     "/docs/:section_code/create",             :controller => "document",        :action => "create"
  map.connect     "/docs/:section_code/edit/:id",           :controller => "document",        :action => "edit"
  map.connect     "/docs/:section_code/update/:id",         :controller => "document",        :action => "update"
  map.connect     "/docs/:section_code/:document_code",     :controller => "section",         :action => "show"
  map.connect     "/docs/:section_code",                    :controller => "section",         :action => "index"
  map.connect     "/js/:id",                                :controller => "document",        :action => "decorate",  :decorate_type => "javascript"
  map.connect     "/css/:id",                               :controller => "document",        :action => "decorate",  :decorate_type => "stylesheet"

  map.connect     ":controller/:action/:id"
  map.connect     ":controller/:action/:id.:format"
end
